package com.youlv.yl.dao;

import com.youlv.yl.dto.HotelOne;
import com.youlv.yl.dto.HotelQueryDto;
import com.youlv.yl.entity.hotel.Hotel;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * 酒店详情 Mapper 接口
 * </p>
 *
 * @author fenghe
 * @since 2022-01-05
 */
@Repository
public interface HotelDao extends BaseMapper<Hotel> {

    /**
     * 酒店模块展示查询
     * @return
     */
    List<HotelQueryDto> select(HotelQueryDto hotelQueryDto);

    @Select("select h.hotelName, h.hotelRank, p.price, h.area, h.addr, h.img, h.id " +
            "from h_hotel h " +
            "inner join h_price p " +
            "on h.id = p.hid " +
            "inner join h_houseType ht " +
            "on p.tid = ht.id " +
            "inner join h_brand b " +
            "on h.bid = b.id " +
            "where p.tid = 1")
    List<HotelQueryDto> selectAll(@Param("tid") Integer tid);

    List<HotelOne> selectOne(HotelOne hotelOne);
}
